package ${entity.packageName};

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;

@Service
public class ${entity.entityName}ServiceImpl implements ${entity.entityName}Service{
    @Autowired
    ${entity.entityName}Mapper ${entity.tableName}Mapper;

    @Override
    public List<${entity.entityName}> getAll(){
        return ${entity.tableName}Mapper.selectList(null);
    }

    @Override
    public ${entity.entityName} getOne(Long id) {
        return ${entity.tableName}Mapper.selectById(id);
    }

    @Override
    public List<${entity.entityName}> getListByIds(List<${entity.columns[0].name}> ids) {
        return ${entity.tableName}Mapper.selectBatchIds(ids);
    }

    @Override
    public void update(${entity.entityName} entity) {
        ${entity.tableName}Mapper.updateById(entity);
    }

    @Override
    public void insert(${entity.entityName} entity) {
        ${entity.tableName}Mapper.insert(entity);
    }

    @Override
    public void delOne(Long id) {
        ${entity.tableName}Mapper.deleteById(id);
    }

    @Override
    public void delByBatch(List<${entity.columns[0].name}> ids) {
        ${entity.tableName}Mapper.deleteByIds(ids);
    }
}